import { defineStore } from "pinia";
import { ref } from "vue";
/**
 * tabBar仓库
 */
export const useTabBarStore = defineStore(
  "tabBarStore",
  () => {
    //  初始化导航栏
    const activeTab = ref(1);
    // 设置导航栏
    const setActiveTab = (active) => {
      activeTab.value = active;
    };

    return {
      activeTab,
      setActiveTab,
    };
  },
  {
    // 开启后对 state 的数据读写都将持久化
    unistorage: true,
  }
);
